<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<?php if(isset($_SESSION['admin'])){?>
<style type="text/css" title="currentStyle">
	@import "<?php echo $this->basePath();?>/scripts/datagrid/css/demo_page.css";
	@import "<?php echo $this->basePath();?>/scripts/datagrid/css/demo_table.css";
	@import "<?php echo $this->basePath();?>/scripts/datagrid/css/demo_table_jui.css";
	@import "<?php echo $this->basePath();?>/scripts/datagrid/css/jquery-ui-1.8.4.custom.css";
</style>
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		executeGrid(ADMIN_BASE_URL+'admin/totalpapers','All');
	} );
	function AddContent(id)
	{
		document.form.action=id;
		document.form.submit();
	}
</script>
<script type="text/javascript" language="javascript" src="<?php echo $this->basePath();?>/scripts/grid_utilities.js"></script>
<script type="text/javascript" src="<?php echo $this->basePath();?>/scripts/thickbox.js"></script>
<div class="admin_main_title">
	<h2>Population Paper</h2><h3><a href="#">&#9660;<!--&#9650;--></a></h3>
	<div class="clearfix"></div>
</div>
<div class="admin_table_pad">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td>
			<table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td valign="top">
						<div id="dt_example" style="">
							<div>
								<select id="districts" name="districts" onchange="return getDistrictAreas('paper');">
								<option value="">Select a district</option>
								<? if($this->list_districts->count()>0){ foreach($this->list_districts as $district){?>									
									<option value="<? echo $district->district_id;?>"><? echo $district->district_name;?></option>
									<?}}else{?>
									<option value="">No districts</option>
								<?}?>												
								</select>
								<select id="areas" name="areas" onchange="return getAreaBasedLocations('paper');">	
								<option value="">Select a area</option>								
								</select>
								<select id="location" name="location" onchange="return getLocationPapers();">	
								<option value="">Select a location</option>								
								</select>
								<select id="paper" name="paper" onChange="return populationPaper();">
								<option value="">Select a paper</option>
									<? if($this->paper_list->count()>0){ foreach($this->paper_list as $papers){ ?>						
										<option value="<? echo $papers->paper_id;?>"><? echo $papers->m_paper_name;?></option>
									<?}?>
								<?}else{?>
									<option value="">No Papers</option>
								<?}?>
								</select>
							</div>
							<div id="">								
								<div id="dynamic">									
									<div align="center" style="color:#FF0000"><?php echo $this->message;?></div>
									<form name="form" id="form" method="post">
										<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
											<thead>
												<tr align="left">
													<th width="10%">Select</th>
													<th width="20%">Location Name</th>
													<th width="10%">Status</th> 
													<th width="10%">Editing Location</th>														
												</tr>
												<tr>
													<td colspan="5" class="gr_bg_ad td_pad0">
														<div class="admin_check_uncheck">
															<div style=" float:left; padding-right:5px; padding-top:7px;">
																<a href="javascript:void(0);" class="button_grey" onclick="checkAll('1','check')"><span ><strong>Check All</strong></span></a> </div>
															<div style=" float:left; padding-right:5px; padding-top:7px;"><a href="javascript:void(0);" class="button_grey" onclick="checkAll('0','check')"><span ><strong>Uncheck All</strong></span></a>
															</div>
															<div style=" float:left; padding-right:5px; padding-top:7px;"><a id="dist_area_loca" href="<?php echo $this->Url('zfcadmin'); ?>/paper-population" title="add" class="button_grey" ><span ><strong>Add Paper</strong></span></a></div>

															<div style=" float:right; padding-right:5px; padding-top:7px;"><a href="javascript:void(0);" class="button_grey" onclick="changeStatus('check','<?php echo $this->Url('zfcadmin'); ?>/population-paper','<?php echo $this->Url('zfcadmin'); ?>/activate','Paper(s) Activated','Activate the paper(s)','All','paper');"><span ><strong>Activate</strong></span></a>
															</div>
															<div style=" float:right; padding-right:5px; padding-top:7px;"><a href="javascript:void(0);" class="button_grey" onclick="changeStatus('check','<?php echo $this->Url('zfcadmin'); ?>/population-paper','<?php echo $this->Url('zfcadmin'); ?>/inactivate','Paper(s) Deactivated',' Deactivate the paper(s)','All','paper');"><span ><strong>Deactivate</strong></span></a>
															</div>
															<div class="clear"></div>
														</div>
													</td>
												</tr>
											</thead>
											<tbody valign="top">
												<tr>
													<td colspan="5" class="dataTables_empty">Loading data from server</td>
												</tr>
											</tbody>
										</table>
									</form>
								</div>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</td></tr>
	</table>
	<div class="clear"></div>
</div>
<? } else {?>
<script>
	window.location=ADMIN_BASE_URL+'admin';
</script>
<?}?>

